﻿<!DOCTYPE html>
<html>
	<head>
		<meta charset="GB2312">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" id="viewport">
		<title>提现记录-迅泊达</title>
		<link rel="shortcut icon" href="favicon.ico"/>
		<link rel="stylesheet" href="css/base.css" />
		<link rel="stylesheet" href="css/withdrawal-record.css" />
		<link rel="stylesheet" href="font/fanhui/iconfont.css" />
		<script src="js/jquery-2.1.4.min.js"></script>
		<script src="js/xbddai.js"></script>
		<script src="js/base.js"></script>
		<script src="js/51size.js"></script>
	</head>
	<body>
		<!--头部开始-->
		<header class="clearfix">
			<div class="header clearfix">
				<ul>
					<li>
						<a href="account-withdrawal.html">
							<i class="iconfont left-icon">&#xe64c;</i>
							<em>返回</em>
						</a>
					</li>
					<li>账号提现</li>
					<li></li>
				</ul>
			</header>
		</header>
		<!--头部结束-->
		<!--主体部分开始-->
		<div class="the-amount-of">
			<p>
				<em id="sumTotal">0.0</em>
				<i>元</i>
			</p>
			<span>提现总额</span>
		</div>
		<div id="listDiv">
			<table id="list">
				<tr class="first">
					<th>提现总额</th>
					<th>手续费</th>
					<th>状态</th>
					<th>到帐金额</th>
				</tr>
			</table>
		</div>
		<!--主体部分结束-->
	</body>
<script type="text/javascript">
var pageIndex = 1;
$(function() {
	var personal=JSON.parse(localStorage.getItem('personal'));
	if(personal==null){
		alert('您还没有登录，请登录！！！');
		window_href('login.html');
	} else{
		var uid=personal.uid;
		//读取提现信息
		$.ajax({
			type: 'post',
			dataType: 'JSON',
			async: false,
			url: baseUrl + "/app/withdraw/list",
			data:{uid:uid},
			success: function(result) {
				var code = result["code"];
				var msg = result["msg"];
				if (code == '-1') {
					var entity = result["entity"];
					$("#sumTotal").text(changePrice2money(result["entity"]["sum"]));
					if(entity["pageList"].length <= 0) {
						$("#list").append("<tr><td></td><td></td><td></td><td></td></tr>");
						$("#listDiv").append('<div style="text-align: center;"><span style="font-size: 1.3em;">没有更多数据</span></div>');
						return;
					}
					var htmlStr = "";
					var count = 0;
					for(var i=0;i<entity["pageList"].length;i++){
						count++;
						var model = entity["pageList"][i];
						var status = model["status"];
						if(status == "apply") {
							status = "待审核";
						}else if(status == "transfer") {
							status = "转账中";
						}else if(status == "apply_failure") {
							status = "审核失败";
						}else if(status == "await") {
							status = "第三方下发处理中";
						}else if(status == "success") {
							status = "转账成功";
						}else if(status == "failure") {
							status = "转账失败";
						}
						htmlStr+='<tr>'+
								'<td>'+
								'<span>'+
								'<i>￥</i>'+
								'<u>'+changePrice2money(model["money"])+'</u>'+
								'</span>'+
								'<em>'+formatFullDate(model["createTime"])+'</em>'+
								'</td>'+
								'<td>'+
								'<i>￥</i>'+
								'<u>'+changePrice2money(model["fee"])+'</u>'+
								'</td>'+
								'<td>'+
								'<span>'+status+'</span>'+
								'</td>'+
								'<td>'+
								'<span>'+
								'<i>￥</i>'+
								'<u>'+changePrice2money(model["balance"])+'</u>'+
								'</span>'+
								//'<em>'+status+'</em>'+
								'</td>'+
								'</tr>';
					}
					if(count == 10) {
						$("#listDiv").append('<div id="move" onclick="move()" style="text-align: center;margin-top:0.5rem;margin-bottom:0.5rem;"><span style="font-size: 1.3em;">查看更多</span></div>');
					}else {
						$("#listDiv").append('<div style="text-align: center;"><span style="font-size: 1.3em;">没有更多数据</span></div>');
					}
					$("#list").append(htmlStr);
				}
			}
		});
	}
});
function move(){
	$("#move").remove();
	var personal=JSON.parse(localStorage.getItem('personal'));
	if(personal==null){
		alert('您还没有登录，请登录！！！');
		window_href('login.html');
	} else{
		var uid=personal.uid;
		//读取提现信息
		$.ajax({
			type: 'post',
			dataType: 'JSON',
			async: false,
			url: baseUrl + "/app/withdraw/list",
			data:{
				uid:uid,
				index:++pageIndex
			},
			success: function(result) {
				var code = result["code"];
				var msg = result["msg"];
				if (code == '-1') {
					var entity = result["entity"];
					$("#sumTotal").text(changePrice2money(result["entity"]["sum"]));
					if(entity["pageList"].length <= 0) {
						$("#list").append("<tr><td></td><td></td><td></td><td></td></tr>");
						$("#listDiv").append('<div style="text-align: center;"><span style="font-size: 1.3em;">没有更多数据</span></div>');
						return;
					}
					var htmlStr = "";
					var count = 0;
					for(var i=0;i<entity["pageList"].length;i++){
						count++;
						var model = entity["pageList"][i];
						var status = model["status"];
						if(status == "apply") {
							status = "待审核";
						}else if(status == "transfer") {
							status = "转账中";
						}else if(status == "apply_failure") {
							status = "审核失败";
						}else if(status == "await") {
							status = "第三方下发处理中";
						}else if(status == "success") {
							status = "转账成功";
						}else if(status == "failure") {
							status = "转账失败";
						}
						htmlStr+='<tr>'+
								'<td>'+
								'<span>'+
								'<i>￥</i>'+
								'<u>'+changePrice2money(model["money"])+'</u>'+
								'</span>'+
								'<em>'+formatFullDate(model["createTime"])+'</em>'+
								'</td>'+
								'<td>'+
								'<i>￥</i>'+
								'<u>'+changePrice2money(model["fee"])+'</u>'+
								'</td>'+
								'<td>'+
								'<span>'+status+'</span>'+
								'</td>'+
								'<td>'+
								'<span>'+
								'<i>￥</i>'+
								'<u>'+changePrice2money(model["balance"])+'</u>'+
								'</span>'+
								//'<em>'+status+'</em>'+
								'</td>'+
								'</tr>';
					}
					if(count == 10) {
						$("#listDiv").append('<div id="move" onclick="move()" style="text-align: center;margin-top:0.5rem;margin-bottom:0.5rem;"><span style="font-size: 1.3em;">查看更多</span></div>');
					}else {
						$("#listDiv").append('<div style="text-align: center;margin-top:0.5rem;margin-bottom:0.5rem;"><span style="font-size: 1.3em;">没有更多数据</span></div>');
					}
					$("#list").append(htmlStr);
				}
			}
		});
	}
}
</script>
</html>
